#include <bits/stdc++.h>
using namespace std;

using ll = long long;

// 迷宫
const ll N = 6; // 5->6
ll n, m, t, a, b, sx, sy, fx, fy, ans;
ll g[N][N];
int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, 1, 0, -1};

void dfs(ll x, ll y)
{
    if (x == fx && y == fy)
    {
        ans++;
        return;
    }
    for (int i = 0; i < 4; i++)
    {
        ll a = x + dx[i], b = y + dy[i];
        if (a < 1 || a > n || b < 1 || b > n)
            continue; // 0->1 y->b
        if (g[a][b])
            continue;
        g[a][b] = 1;
        dfs(a, b);
        g[a][b] = 0;
    }
}

int main()
{
    cin >> n >> m >> t >> sx >> sy >> fx >> fy; // sy->fy
    for (int i = 0; i < t; i++)
        cin >> a >> b, g[a][b] = 1;
    g[sx][sy] = 1;
    dfs(sx, sy);
    cout << ans << endl;
    system("pause");
    return 0;
}